package com.example.duomeitijuhe.ui.myview;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import com.example.duomeitijuhe.R;
import com.example.duomeitijuhe.ui.fragments.MainActivity;

/**
 * Created by Michael on 2014/10/14.
 */
public class MyselfTitleView extends FrameLayout {

    private Button dynamicButton;

    public MyselfTitleView(final Context context,AttributeSet attributeSet){
        super(context,attributeSet);
        if (isInEditMode()){
            return;
        }

        View view = LayoutInflater.from(context).inflate(R.layout.myself_title,this);
        dynamicButton = (Button)view.findViewById(R.id.my_to_dynamic_button);
        dynamicButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, MainActivity.class);
                context.startActivity(intent);
            }
        });
    }
}
